3 var linetext, drawletter;
4 var w, h = 800, v = 60, seed = Date.seed, run = true;
5 var time, name, sourcestring;
6 var yellowness, penwidth, pen;
8 //name=[\s,\u,\p,\e,\r,\c,\o,\l,\l,\i,\d,\e,\r];
10 //sourcestring= "any lower case text";
12 sourcestring= "welcome to supercollider";
14 name=Array.fill(sourcestring.size,{arg i; sourcestring[i].asSymbol});
19 'a':[[[0,1],[0.5,0]],[[0.5,0],[1,1]],[[0.25,0.5],[0.75,0.5]]],
20 'b':[[[0,1],[0,0]],[[0,1],[1,1]],[[0,0],[1,0]],[[0,0.5],[0.75,0.5]],[[0.75,0.5],[1,0.75]],[[0.75,0.5],[1,0.25]],[[1,0.75],[1,1]],[[1,0.25],[1,0]]],
21 'c':[[[0,1],[0,0]],[[0,0],[1,0]],[[0,1],[1,1]]],
22 'd':[[[0,1],[0,0]],[[0,0],[0.75,0]],[[0,1],[0.75,1]],[[0.75,1],[1,0.75]],[[0.75,0],[1,0.25]],[[1,0.25],[1,0.75]]],
23 'e':[[[0,0],[0,1]],[[0,0],[1,0]],[[0,1],[1,1]],[[0,0.5],[1,0.5]]],
24 'f':[[[0,0],[0,1]],[[0,0],[1,0]],[[0,0.5],[1,0.5]]],
25 'g':[[[0,1],[0,0]],[[0,0],[1,0]],[[0,1],[1,1]],[[1,1],[1,0.5]],[[0.5,0.5],[1,0.5]]],
26 'h':[[[0,1],[0,0]],[[0,0.5],[1,0.5]],[[1,1],[1,0]]],
27 'i':[[[0,0],[1,0]],[[0.5,0],[0.5,1]],[[0,1],[1,1]]],
28 'j':[[[0,0],[1,0]],[[0.5,0],[0.5,1]],[[0,1],[0.5,1]]],
29 'k':[[[0,1],[0,0]],[[0,0.5],[1,1]],[[0,0.5],[1,0]]],
30 'l':[[[0,1],[0,0]],[[0,1],[1,1]]],
31 'm':[[[0,1],[0,0]],[[0,0],[0.5,0.5]],[[0.5,0.5],[1,0]],[[1,0],[1,1]]],
32 'n':[[[0,1],[0,0]],[[0,0],[1,1]],[[1,1],[1,0]]],
33 'o':[[[0,1],[0,0]],[[0,0],[1,0]],[[0,1],[1,1]],[[1,0],[1,1]]],
34 'p':[[[0,0],[0,1]],[[0,0],[1,0]],[[0,0.5],[1,0.5]],[[1,0],[1,0.5]]],
35 'q':[[[0,0],[0,0.75]],[[0,0],[0.75,0]],[[0,0.75],[0.75,0.75]],[[0.75,0],[0.75,0.75]],[[0.5,0.5],[1,1]]],
36 'r':[[[0,0],[0,1]],[[0,0],[1,0]],[[0,0.5],[1,0.5]],[[1,0],[1,0.5]],[[0,0.5],[1,1]]],
37 's':[[[0,0],[0,0.5]],[[0,0],[1,0]],[[0,1],[1,1]],[[0,0.5],[1,0.5]],[[1,0.5],[1,1]]],
38 't':[[[0,0],[1,0]],[[0.5,0],[0.5,1]]],
39 'u':[[[0,1],[0,0]],[[0,1],[1,1]],[[1,0],[1,1]]],
40 'v':[[[0,0],[0.5,1]],[[0.5,1],[1,0]]],
41 'w':[[[0,0],[0.25,1]],[[0.25,1],[0.5,0.5]],[[0.5,0.5],[0.75,1]],[[0.75,1],[1,0]]],
42 'x':[[[0,0],[1,1]],[[0,1],[1,0]]],
43 'y':[[[0,0],[0.5,0.5]],[[0.5,0.5],[1,0]],[[0.5,0.5],[0.5,1]]],
44 'z':[[[0,1],[1,0]],[[0,0],[1,0]],[[0,1],[1,1]]],
45 (" ".asSymbol):[[[0,1],[1,1]],[[0,0.8],[0,1]],[[1,0.8],[1,1]]]
48 w = Window("welcome", Rect(40, 500, h, v));
49 w.view.background = Color.blue(0.5);
50 w.onClose = { run = false };
54 drawletter={arg which, startx, starty, xscale=100, yscale,prop=1.0;
57 yscale= yscale ? xscale;
59 data= linetext[which];
61 prop=(round((data.size)*prop).asInteger).max(1);
67 pen.line(Point(startx+(xscale*val[0][0]),starty+(yscale*val[0][1])),Point(startx+(xscale*val[1][0]),starty+(yscale*val[1][1])));
75 yellowness=rrand(0.7,0.9);
81 pen.use {var xoscil, xsizoscil,yoscil, todraw, usedtime;
84 pen.color=Color.yellow(yellowness);
86 usedtime=time.min(1.0);
88 todraw=(round((name.size)*usedtime).asInteger).max(1);
92 xoscil= sin(2*pi*time+(j*pi*0.13))*140/(1+(10*time));
94 yoscil= sin(2*pi*time+(j*pi*0.03))*200/(1+(200*time));
98 drawletter.value(name[j],50+(25*j)+(xoscil),10+yoscil,xsizoscil,xsizoscil,usedtime);
107 { while { time<2.0 } {
110 time=(time+0.025); //%2.0;
111 0.05.wait; } }.fork(AppClock)